home *** CD-ROM | disk | FTP | other *** search
- /* %filename% */
- /* Created %date% %time% by AppMaker */
-
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Controls.h>
- #include <Dialogs.h>
- #include <Events.h>
- #include <Lists.h>
- #include <Menus.h>
- #include <TextEdit.h>
- #include "Globals.h"
-
- /*Standard vars:*/
- Boolean quittingTime;
- EventRecord curEvent;
- WindowPtr curWindow;
- WinInfoPtr cur;
- Boolean inBackground;
- SysConfigRec sysConfig;
-
- WinInfoRec noCur;
-
- %If lang = MPW%
- #pragma segment Globals
-
- %end if%
- /*----------*/
- void InitGlobals (void)
- {
- curWindow = nil;
- noCur.text = nil;
- noCur.vScroll = nil;
- noCur.hScroll = nil;
- noCur.fileNum = 0;
- noCur.volNum = 0;
- noCur.dirty = false;
- noCur.windowKind = noWindow;
-
- cur = &noCur;
- } /*InitGlobals*/
-
- /*----------*/
- void SetInfo (WindowPtr window)
- {
- WinInfoPtr infoPtr;
-
- if (window != curWindow) {
- curWindow = window;
- if (curWindow != nil) {
- infoPtr = (WinInfoPtr) GetWRefCon (curWindow);
- cur = infoPtr;
- } else {
- cur = &noCur;
- }
- }
- } /*SetInfo*/
-
- /*----------*/
- void SetNewInfo (WindowPtr window)
- {
- WinInfoPtr infoPtr;
-
- infoPtr = (WinInfoPtr) NewPtr (sizeof (WinInfoRec));
- SetWRefCon (window, (long) infoPtr);
- SetInfo (window);
- } /*SetNewInfo*/
-
- /*----------*/
- void DiscardInfo (WindowPtr window)
- {
- WinInfoPtr infoPtr;
-
- if (window == curWindow) {
- SetInfo (nil);
- }
- infoPtr = (WinInfoPtr) GetWRefCon (window);
- DisposPtr ((Ptr) infoPtr);
- HideWindow (window);
- DisposeWindow (window);
- } /*DiscardInfo*/
-
- /* Globals */
-